package sg.edu.nus.iss.vmcs.util;

import java.util.Hashtable;

public class UndoManager {
	private static UndoManager instance;
	private Hashtable<String,CommandHistory> commandStore;
	
	private UndoManager(){		
	}
	
	public static UndoManager getInstance(){
		if(instance==null)
			instance=new UndoManager();
		return instance;
	}
	
	public void putCommandHistory(String key,CommandHistory value){
		if(commandStore==null)
			commandStore=new Hashtable<String,CommandHistory>();
		commandStore.put(key, value);
	}
	
	public CommandHistory getCommandHistory(String key){
		if(commandStore==null)
			commandStore=new Hashtable<String,CommandHistory>();
		return commandStore.get(key);
	}
	
	
}
